<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Select Tag With Options Source tag Example</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
<h1 align="center">Select Tag With Options Source tag Example</h1>

<h2>Description:</h2>
This page demonstrates how to use&#123;&#123;select_options_export&#125;&#125; tag to create &#123;&#123;select&#125;&#125; tag options variable.

{{form name='my_form1' from='$#my_form1' method='POST'}}

<? if(isset($this->my_form1['my_select1'])) { ?>
<p>You selected: "{$#my_form1.my_select1}" in the first select</p>
<? } ?>

<? if(isset($this->my_form1['my_select2'])) { ?>
<p>You selected: "{$#my_form1.my_select2}" in the second select</p>
<? } ?>

{{select_options_export from='$#my_options_source1' to='$options1' key_field='id' text_field='title'/}}

Select an option: {{select id='my_select1' name='my_select1' options='$options1'/}}
                  
<? if(isset($this->my_form2['my_select2'])) { ?>
<p>You selected: {$#my_form2.my_select2}</p>
<? } ?>

<p/>

{{select_options_export from='$#my_options_source2' to='$options2' key_field='id' text_field='title'/}}

Selector with default options: {{select id='my_select2' name='my_select2' options='$options2'}}
                                 {{option value='nothing' prepend='true'}}--Select something--{{/option}}
                                 {{option value='everything'}}--Nothing to select?--{{/option}}
                               {{/select}}

<input type='submit' name='button' value='Send!'/>
{{/form}}

</body>
</html>
